package netty.transport;

import java.net.SocketAddress;

public interface Channel {

    /**
     * 获取全局唯一id
     */
    ChannelId chanelId();

    /**
     * 获取当前channel所注册的EventLoop
     */
    EventLoop eventLoop();

    /**
     * 获取当前channel的configuration
     */
    ChannelConfig channelConfig();

    boolean isOpen();

    boolean isRegistered();

    boolean isActive();

    SocketAddress localAddress();

    SocketAddress remoteAddress();

    /**
     * 获取pipeline
     */
    ChannelPipeline pipeline();


    Unsafe unsafe();

    interface Unsafe {
        void bind(SocketAddress localAddress);
    }

}
